package com.guoyw.seata.order.controller;

import com.guoyw.seata.common.dto.OrderDTO;
import com.guoyw.seata.common.response.ObjectResponse;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 订单服务
 * author: guoyw
 * create: 2020-09-19 16:34
 **/

@RestController
@RequestMapping("/order")
@Slf4j
public class TOrderController{
  
  @Autowired
  private ITOrderService orderService;
  
  @PostMapping("/create_order")
  ObjectResponse<OrderDTO> createOrder(@RequestBody OrderDTO orderDTO){
    log.info("请求订单微服务：{}",orderDTO.toString());
    return orderService.createOrder(orderDTO);
  }
  
}
